package com.hww.dtalk.spi;

import com.hww.dtalk.App;
import com.hww.dtalk.IPUtils;
import com.hww.dtalk.MacUtil;

import net.gdface.utils.FaceUtilits;

import gu.dtalk.DeviceInfoProvider;

public class DeviceInfoProviderImpl implements DeviceInfoProvider {

    @Override
    public String getPassword() {
        return FaceUtilits.toHex(getMac()).substring(8);
    }

    @Override
    public void savePassword(String password) {
    }

    @Override
    public byte[] getMac() {
        return MacUtil.getMACByte();
    }

    @Override
    public String getMacAsString() {
        return MacUtil.getMAC();
    }

    @Override
    public byte[] getIp() {
        return IPUtils.getInstance().getIPAddress(App.getInstance()).getBytes();
    }

    @Override
    public String getIpAsString() {
        return IPUtils.getInstance().getIPAddress(App.getInstance());
    }
}
